package com.zr.Inquiry.meiju;

/**
 * Created by Liyiding on 2019/9/27.
 */
public enum InquiryStatusEnum {
    BAOJIA(0,"未报价"),BAOCUN(1,"已保存"),TIJIAO(2,"已提交"),SHENHE(3,"已审核"),ZUOFEI(50,"已作废");

    private final String inquiryStatusName;
    private final Integer inquiryStatusValue;

    private InquiryStatusEnum(Integer inquiryStatusValue, String inquiryStatusName)
    {
        this.inquiryStatusName = inquiryStatusName;
        this.inquiryStatusValue = inquiryStatusValue;
    }

    // 通过值取名称
    public static String getName(int inquiryStatusValue) {
        for (InquiryStatusEnum i : InquiryStatusEnum.values()) {
            if (i.getInquiryStatusValue() == inquiryStatusValue) {
                return i.inquiryStatusName;
            }
        }

        return null;
    }
    // 通过名称取值
    public static Integer getValue(String inquiryStatusName) {
        for (InquiryStatusEnum i : InquiryStatusEnum.values())
            if (i.getInquiryStatusName().equals(inquiryStatusName)) {
                return i.getInquiryStatusValue();
            }
        return null;
    }

    public String getInquiryStatusName() {
        return inquiryStatusName;
    }

    public Integer getInquiryStatusValue() {
        return inquiryStatusValue;
    }
}
